package igeomap.controller;

import java.io.File;


import igeomap.domain.CameraPreviewHolder;
import igeomap.domain.LocationHolder;
import igeomap.foundation.CreateFotoHolder;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.util.Log;
import android.view.SurfaceView;

public class ControllerScattaFoto {
	private static ControllerScattaFoto controllerScattaFoto=null;
    private LocationHolder locationHolder;
	private CameraPreviewHolder cameraPreviewHolder;

	
		public static ControllerScattaFoto getControllerScattaFotoIstance()
		{
			if(controllerScattaFoto==null)
			{
				controllerScattaFoto=new ControllerScattaFoto();
			
			}
			return controllerScattaFoto;
		}
		
		public void setCameraPreview(SurfaceView cameraPreview)
		{
			cameraPreviewHolder= new CameraPreviewHolder(cameraPreview);
		}
	
		public void takePicture( )
		{
			cameraPreviewHolder.TakePicture();
			
		}

		public void AttivaRilevaLuogo() {
			// TODO Auto-generated method stub
			locationHolder.AttivaRilevamentoLuogo();
		}
		public void DisattivaRilevaLuogo() {
			// TODO Auto-generated method stub
			locationHolder.StopFix();
		}
		public boolean IsBestProvider(Context context) {
			// TODO Auto-generated method stub
		
			locationHolder=LocationHolder.getLocationHolderInstance();
			locationHolder.InizializzaLocationHolder(context);
			if(locationHolder.getBestProvider()==null)
			return false;
			else
			{
			AttivaRilevaLuogo();
			return true;
			}
		}
		

		
		
}
